﻿using ZXthex;

sealed class ExampleB :FromC
{
    delegate void SwapFunction(ref string s1, ref string s2);

    SwapFunction fun;

    /// <summary>
    ///
    /// #include "stdafx.h"
    ///
    /// EXTERN_C{
    ///
    ///	    __declspec(dllexport)  void swapx(char** value1, char** value2)
    ///     {
    ///         char* temp = *value1;
    ///         *value1 = *value2;
    ///         *value2 = temp;
    ///     }
    /// }
    ///
    ///
    /// </summary>
    public ExampleB() : base(@"dlls/Dll2x.dll")
    {
        fun = GetFunction<SwapFunction>("swapx");
    }

    public void Invoke(ref string s1, ref string s2)
    {
        fun(ref s1, ref s2);
    }

}
